.
 Vyom World.com  . Let's Touch the Sky Together!  
.
. . . . . . .
 Home
VyomWorld.com Home
Free Magazines!
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
 Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
 Fun
Screensavers New!
Send FREE SMS!
SMS Jokes
 Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
 GATE
GATE an Overview
GATE Preparation
Study Materal
 GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
 TOEFL Preparation
TOEFL Resources
 GMAT Preparation
GMAT Resources
 MBA Preparation
MBA Resources
 Networking Concepts
Networking Concepts
 Testing Preparation
Testing Resources
 Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
 Tutorials
Hardware Tutorial
1500 Free eBooks New!
 FREE Publications
Vyom Career eMag.
 
.
Get 9,000+ Interview Questions & Answers in an eBook.


  • 9,000+ Interview Questions
  • All Questions Answered
  • 5 FREE Bonuses
  • Free Upgrades

    Get it now!


    Post your Resume to 5800+ Companies

    Reliable Web Hosting

  •  
     
     
    Get 9,000+ Interview Questions with Answers in an eBook

    Advertisements
    Advertisements

    C Source Codes List | Source Code Home
    Program : Program for finding the transpose of a martix in sparse form.
    /* Program for finding the transpose of a martix in sparse form*/ #include <stdio.h> #include <conio.h> int a[100][100],b[100][100]; void main() { int i,m,n,p,q,col,t; clrscr(); printf("Enter the no. of rows"); scanf("%d", &a[0][0]); printf("\nEnter the no. of cols"); scanf("%d", &a[0][1]); printf("\nEnter the number of non zero terms"); scanf("%d", &a[0][2]); for(i=1;i<=a[0][2];i++) { printf("\nEnter the value (that is non zero)"); scanf("%d",&a[i][2]); printf("\nEnter the row for %d : ",a[i][2]); scanf("%d",&a[i][0]); printf("\nEnter the col for %d : ",a[i][2]); scanf("%d",&a[i][1]); } /* Printing for testing the sparse input */ printf("\n *****************************\n The martix you entered is \n ************************\n\n Row \t Col \t Value \t"); for ( i = 0;i <= a[0][2];i++) { printf("\n %d \t %d \t %d \t " , a[i][0],a[i][1],a[i][2]); } /* Calling function for evaluation of transpose */ m = a[0][0]; n = a[0][1]; t = a[0][2]; b[0][0] = n; b[0][1] = m; b[0][2] = t; q=1; for( col = 1; col <=n; col++) { for(p = 1; p<=t;p++) { if(a[p][1] == col) { b[q][0] = a[p][1]; b[q][1] =a[p][0]; b[q][2] = a[p][2]; q++; } } } //end of outer for loop /* Printing the transposed matrix */ getch(); printf("\nThe Transpose of the above matrix is "); for ( i = 0;i <= a[0][2];i++) { printf("\n %d \t %d \t %d \t " , b[i][0],b[i][1],b[i][2]); } getch(); }

     

    C Source Codes List | Source Code Home

     




     

    .

    Recently Updated: New Placement Papers added.
    Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

    Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy